import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)
const originalPush = Router.prototype.push
//修改原型对象中的push方法
Router.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}

export default new Router({
  routes: [
    {
      path: '*',
      redirect: '/home'
    }, {
      path: '/home',
      name: 'home',
      // component: resolve => require(['@/view/HomePage'], resolve),
      // component: resolve => require(['@/view/Home'], resolve),
      component: resolve => require(['@/view/Home2'], resolve),
    }, {
      path: '/aboutUs',
      name: 'aboutUs',
      // component: resolve => require(['@/view/HomePage'], resolve),
      // component: resolve => require(['@/view/Home'], resolve),
      component: () => import("@/view/AboutUs"),
    }, {
      path: '/Article',
      name: 'Article',
      // component: resolve => require(['@/view/HomePage'], resolve),
      // component: resolve => require(['@/view/Home'], resolve),
      component: () => import("@/view/Article"),
    }, {
      path: '/newsinformation',
      name: 'newsinformation',
      // component: resolve => require(['@/view/NewsInformation'], resolve),
      component: () => import("@/view/NewsInformation"),
    }, {
      path: '/companyintroduction',
      name: 'companyintroduction',
      // component: resolve => require(['@/view/CompanyIntroduction'], resolve),
      component: () => import("@/view/CompanyIntroduction"),
    }, {
      path: '/contactus',
      name: 'contactus',
      component: () => import("@/view/ContactUs"),
    }, {
      path: '/photocaption',
      name: 'photocaption',
      component: () => import("@/view/PhotoCaption"),
    }
    // {
    //   path: '/',
    //   name: 'PageView',
    //   component: () => import("@/view/PageView"),
    //   children: [
    //   ]
    // }

  ]
})
